<?php

class users extends CI_Model{
	
	// read all data from TB_user
	
	function getAll(){
		$this->load->database();
		$q = $this->db->query("Select * from TB_User");   //create a SQL query
		if ($q->num_rows()>0) {  //only read data when table is not empty
			
			foreach ($q->result() as $row) {
				$data[] = $row;
			}
		
            return $data;			

		}
		
	}
	
	
}




